package hunan.cxb18.util;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

/**
 * @author chenheng
 * @create 2020-02-23 11:31
 */
public class DButils {
    private static final String username;
    private static final String pwd;
    private static final String url;
    private static final String driverClass;
    static {
        Properties pro = new Properties();
        InputStream is=DBUtils.class.getClassLoader().getResourceAsStream("db.properties");
        try {
            pro.load(is);
            username = pro.getProperty("username");
            pwd=pro.getProperty("pwd");
            url=pro.getProperty("url");
            driverClass=pro.getProperty("driverclass");
            Class.forName(driverClass);
        } catch (IOException | ClassNotFoundException e) {
            e.printStackTrace();
        }
    }


}
